#ifndef PRJ_CFG_H
#define PRJ_CFG_H

#include "tcpci_config.h"

/****************************************
 *              USB-IF VIF              *
 ****************************************/
// General PD
#define MANUFACTURER_INFO_VID_PORT    0x377E  // Get_Manufactor_Info
#define MANUFACTURER_INFO_PID_PORT    0x6600
#define CHUNKING_IMPLEMENTED_SOP      0  // 0-false
#define UNCHUNKED_EXTENDED_MESSAGES_SUPPORTED    0
#define UNCONSTRAINED_POWER           0
#define NUM_FIXED_BATTERIES           1
#define NUM_SWAPPABLE_BATTERY_SLOTS   0
#define ID_HEADER_CONNECT_TYPE_SOP    2  // 2-Receptable 3-Plug

// PD Capabilities
#define USB_COMMS_CAPABLE             0

// USB Type-C®
#define TYPE_C_CAN_ACT_AS_HOST        0  // 0-false 1-true
#define TYPE_C_CAN_ACT_AS_DEVICE      0  // 0-false 1-true
#define TYPE_C_IMPLEMENTS_TRY_SNK     1  // 1-true
#define RP_VALUE                      0  // 0-default 1-1.5A 2-3A

// Product Power
#define PRODUCT_TOTAL_SOURCE_POWER_MW 5000

// PD Source
#define PD_POWER_AS_SOURCE            5000  // unit:mW
#define EPR_SUPPORTED_AS_SRC          0
#define USB_SUSPEND_MAY_BE_CLEARED    1  // 1-true, may clear PDO_FIXED_SUSPEND
#define NUM_SRC_PDOS                  1
// Source Fixed PDO
#define SRC_PDO_SUPPLY_TYPE           0  // 0-Fixed 1-Variable 2-Battery 3-APDO
#define SRC_PDO_PEAK_CURRENT          0  // 0-100% 1-130% 2-150% 3-200%
#define SRC_PDO_VOLTAGE               100  // unit:50mV
#define SRC_PDO_MAX_CURRENT           100  // unit:10mA

// PD Sink
#define PD_POWER_AS_SINK              15000
#define NO_USB_SUSPEND_MAY_BE_SET     1
#define FR_SWAP_REQD_TYPE_C_CURRENT_AS_INITIAL_SOURCE    0  // 0-Not Supported
#define NUM_SNK_PDOS                  1
// Sink Fixed PDO + APDO
#define SNK_PDO0_SUPPLY_TYPE          0  // 0-Fixed 1-Variable 2-Battery 3-APDO
#define SNK_PDO0_VOLTAGE              100  // unit:50mV
#define SNK_PDO0_OP_CURRENT           300  // unit:10mA
#if NUM_SNK_PDOS == 2
#define SNK_PDO1_SUPPLY_TYPE          3
#define SNK_PDO1_APDO_TYPE            0
#define SNK_PDO1_MIN_VOLTAGE          50  // unit: 100mV
#define SNK_PDO1_MAX_VOLTAGE          60 // unit: 100mV
#define SNK_PDO1_OP_CURRENT           60  // unit: 50mA
#undef CONFIG_USB_PD_REV30_PPS_SINK
#define CONFIG_USB_PD_REV30_PPS_SINK  1 // support pps sink capability
#endif

// Dual Role

// SOP Discover ID
#define XID_SOP                           0x00000000
#define DATA_CAPABLE_AS_USB_HOST_SOP      0  // 0-false
#define DATA_CAPABLE_AS_USB_DEVICE_SOP    0  // 0-false
#define PRODUCT_TYPE_UFP_SOP              3  // SOP: 0-NoUFP 1-Hub 2-Peripheral 3-PSD
#define PRODUCT_TYPE_DFP_SOP              2  // SOP: 0-NoDFP 1-Hub 2-Host 3-Brick
#define DFP_VDO_PORT_NUMBER               1
#define MODAL_OPERATION_SUPPORTED_SOP     0  // 0-no 1-yes
#define USB_VID_SOP                       0x377E  // USB Vendor ID
#define PID_SOP                           0x6600  // USB Product ID
#define BCDDEVICE_SOP                     0x0000

/****************************************
 *                 DTS                  *
 ****************************************/
#define BAT_VID   0xFFFF
#define BAT_PID   0x6600

#if USB_COMMS_CAPABLE == 1
#define HOST_CAPABILITY                   0x3  // B0-USB2 B1-USB3 B2-USB4
#else
#define HOST_CAPABILITY                   0
#endif

#endif

